package com.jwt.config;

import com.jwt.Interceptor.JWTIntrtcptore;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//配置拦截器
@Configuration
public class Config implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
      registry.addInterceptor(new JWTIntrtcptore())
              .addPathPatterns("/token/s")  //拦截
              .addPathPatterns("/token/ss")
              .excludePathPatterns("/user/login");  //用户放行
    }
}
